package com.itany.corejava.day03;

import java.util.Scanner;

public class Test12 {

    public static void main(String[] args) {

//        System.out.println("输入成绩[0-100]:");
//        Scanner sc=new Scanner(System.in);
//
//        int score=sc.nextInt();
//
//        while(score<0||score>100){
//            System.out.println("分数无效");
//            System.out.println("输入成绩[0-100]:");
//            score=sc.nextInt();
//        }




        Scanner sc=new Scanner(System.in);
        int score;
        do {
            System.out.println("输入成绩[0-100]:");
            score = sc.nextInt();
        }while(score<0||score>100);


        System.out.println("判断等级");

        char level;

        if(score>=90){
            level='A';
        }else if(score>=80){
            level='B';
        }else if(score>=70){
            level='C';
        }else if(score>=60){
            level='D';
        }else{
            level='E';
        }


        System.out.println("等级为："+level);



        switch (score/10){
            //100
            case 10:
                level='A';
                break;
            //90-99
            case 9:
                level='A';
                break;
            case 8:
                level='B';
                break;
            case 7:
                level='C';
                break;
            case 6:
                level='D';
                break;
            default:
                level='E';
                break;
        }

        System.out.println("等级为："+level);



    }
}
